package com.qiang.test02;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.UnsupportedEncodingException;

public class Demo01 {
    public static void main(String[] args) throws IOException {
        /*String s = "中国";
        byte[] bytes = s.getBytes("GBK");
        System.out.println(bytes);
        for (byte aByte : bytes) {
            System.out.println(aByte);
        }*/
/*
        byte[] bb = {-28, -72, -83, -27, -101, -67};
        String s1 = new String(bb,"UTF-8");
        System.out.println(s1);*/

        //FileWriter fw = new FileWriter("day12\\aa.txt");
        /*fw.write(99);
        fw.write("\r\n");
        fw.write("123");
        fw.write("\r\n");
        fw.write('2');
        fw.close();*/
       /* String s = "中国";
        fw.write(s);
        fw.write("\r\n");
        char[] c = {'1', '2','3'};
        fw.write(c,1,2);
        fw.close();*/

        FileReader fr = new FileReader("day12\\aa.txt");
        int read = fr.read();
        while(read!=-1){
            System.out.println((char)read);
            read = fr.read();
        }
        //fr.close();
        //System.out.println((char)read);

    }
}
